<%@page contentType="text/html;charset=utf-8"%>
<%@include file="../../core/common.jsp"%>
<%@include file="../plugins/ys.jsp"%>
<html>
<head>
<title></title>
</head>
<script>
	function rkfx_(value, row, index) {
		var mx = template("rkfx_ys", {
			list : row.fxmx
		});
		return mx;
	}
	function ckfx_(value, row, index) {
		var mx = template("ckfx_ys", {
			list : row.fxmx
		});
		return mx;
	}
	function pcfx_(value, row, index) {
		var mx = template("pcfx_ys", {
			list : row.fxmx
		});
		return mx;
	}
	function ckjl_(value, row, index) {
		var a = [];
		for (var i = 0; i < row.ckjl.length; i++) {
			a.push(row.ckjl[i].mx + '(' + row.ckjl[i].zl + ')');
		}
		return a;
	}
</script>
<body>
	<div id="tb" class="toolbar">
		<form id="fm">
			<table class="form-layout w80">
				<tr>
					<td>产品编号：</td>
					<td><input name="search_cpbh" class="easyui-textbox" /></td>
					<td>规格型号：</td>
					<td><input name="search_ggxh" class="easyui-combobox" data-options="url:'${CTX}/mgt/sys/dict/value/ph',editable:false,formatter:''" /></td>
					<td>入库期起：</td>
					<td><input name="search_begin" class="easyui-datebox" data-options="editable:false" /></td>
					<td>入库期止：</td>
					<td><input name="search_end" class="easyui-datebox" data-options="editable:false" /></td>
				</tr>
			</table>
		</form>
		<div style="float: left;">
			<shiro:hasPermission name="crk:dc">
				<a id="dc" class="form-btn success">
					<i class="fa fa-file-excel-o m-r-5"></i>导出
				</a>
			</shiro:hasPermission>
		</div>
		<div style="float: right;">
			<a id="find" class="form-btn success">
				<i class="fa fa-search m-r-5"></i>查询
			</a>
			<a id="reset" class="form-btn default">
				<i class="fa fa-undo m-r-5"></i>重置
			</a>
		</div>
		<div style="clear: both;"></div>
	</div>
	<table id="dg" class="easyui-datagrid" data-options="url:'${CTX}/mgt/t/crk/find',toolbar:'#tb',pagination:true">
		<thead>
			<tr>
				<th data-options="field:'cpbh',width:100">产品编号</th>
				<th data-options="field:'kqmc',width:200">库区名称</th>
				<th data-options="field:'kh',width:100">客户</th>
				<th data-options="field:'rkfx',width:250,formatter:rkfx_">入库分析</th>
				<th data-options="field:'fxsj',width:100">分析时间</th>
				<th data-options="field:'ckfx',width:250,formatter:ckfx_">出库分析</th>
				<th data-options="field:'rkrq',width:100">入库日期</th>
				<th data-options="field:'rkzl',width:90">入库重量(kg)</th>
				<th data-options="field:'zkzl',width:90">在库重量(kg)</th>
				<th data-options="field:'ks',width:50">捆数</th>
				<th data-options="field:'ckjl',width:200,formatter:ckjl_">出库记录</th>
				<th data-options="field:'kz',width:50">K值</th>
				<th data-options="field:'jcz',width:50">检查者</th>
				<th data-options="field:'qrz',width:50">确认者</th>
				<th data-options="field:'pcfx',width:250,formatter:pcfx_">偏差分析</th>
			</tr>
		</thead>
	</table>
</body>
<script>
	$(function() {
		$('#find').click(function() {
			$('#dg').datagrid('reload', $('#fm').serializeObject());
		});
		$('#reset').click(function() {
			$('#fm').form('reset');
			$('#find').click();
		});
		$('#dc').click(function() {
			var param = '?' + $('#fm').serialize();
			window.location.href = '${CTX}/mgt/t/crk/dc' + param;
		});
	});
</script>
</html>